<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title> -主页</title>

    <meta name="keywords" content="">
    <meta name="description" content="">


    <link rel="shortcut icon" href="favicon.ico"> <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css?v=4.1.0" rel="stylesheet">

    <style>
        #testAccount{
            width: 400px;
            height: 37px;
            border: 1px;
            font-size: 16px;
            line-height: 24px;
            text-align: center;
            padding: 0;
            margin-left:28px;
            cursor:pointer;
            margin-bottom: 50px;
            margin-top: 0px;
        }
        #dayAccount{
            width: 369px;
            height: 37px;
            border: 1px;
            font-size: 16px;
            line-height: 24px;
            text-align: center;
            padding: 0;
            margin-left:28px;
            cursor:pointer;
        }
        #weekAccount{
            width: 400px;
            height: 37px;
            border: 1px;
            font-size: 16px;
            line-height: 24px;
            text-align: center;
            padding: 0;
            margin-left:28px;
            cursor:pointer;
            margin-bottom: 50px;
        }

        #monthAccount{
            width: 369px;
            height: 37px;
            border: 1px;
            font-size: 16px;
            line-height: 24px;
            text-align: center;
            padding: 0;
            margin-left:28px;
            cursor:pointer;
        }
        #row1{
            width: 900px;
            /*border: 1px solid red;*/
            height: 149px;
        }

        #row2{
            height: 149px;
        }


        .discount{
            display: block;
            width: 200px;
            height: 15px;
            /* border: 1px solid red; */
            font-size: 15px;
            margin-top: 12px;
            padding: 0px;
        }
        }
    </style>


    <script>

    </script>
</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div id="row2" class="row">
        <div class="col-sm-3">
            <div class="widget style1">
                <div class="row">
                    <div class="col-xs-4 text-center">
                        <i class="fa fa-trophy fa-5x"></i>
                    </div>
                    <div class="col-xs-8 text-right">
                        <span> 余额 </span>
                        <h2 class="font-bold">&yen; <?php echo e($data['info']['balance']); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="widget style1 lazur-bg">
                <div class="row">
                    <div class="col-xs-4">
                        <i class="fa">基础套餐</i>
                        <span class="discount">基础套餐日卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['primary-day']); ?></span>
                        <span class="discount">基础套餐周卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['primary-week']); ?></span>
                        <span class="discount">基础套餐月卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['primary-month']); ?></span>
                    </div>
                </div>
            </div>
        </div>

    </div>


    <div class="col-sm-3">
        <div class="widget style1 lazur-bg">
            <div class="row">
                <div class="col-xs-4">
                    <i class="fa">中级套餐</i>
                    <span class="discount">基础套餐日卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['middle-day']); ?></span>
                    <span class="discount">基础套餐周卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['middle-week']); ?></span>
                    <span class="discount">基础套餐月卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['middle-month']); ?></span>
                </div>
            </div>
        </div>
    </div>

    <div class="col-sm-3">
        <div class="widget style1 lazur-bg">
            <div class="row">
                <div class="col-xs-4">
                    <i class="fa">高级套餐</i>
                    <span class="discount">基础套餐日卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['height-day']); ?></span>
                    <span class="discount">基础套餐周卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['height-week']); ?></span>
                    <span class="discount">基础套餐月卡费用 &nbsp;&nbsp; ￥ <?php echo e($data['info']['height-month']); ?></span>
                </div>
            </div>
        </div>
    </div>



        <?php /*************************      服务器列表         ********************************/ ?>
    <div style="float:right;margin-top: -150px;" class="col-sm-6">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>服务器列表</h5>
            </div>
            <div class="ibox-content">

                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>地区</th>
                            <th>运营商</th>
                            <th>IP</th>
                            <th>状态</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach($data['line'] as $value): ?>
                            <tr style="color:green;text-align: center;">
                                <td colspan="4"><?php echo e($value['province']); ?></td>
                            </tr>
                            <tr>
                                <?php foreach($value['city'] as $item): ?>
                                    <tr>
                                        <td style="color:red;"><?php echo e($item['province']); ?><?php echo e($item['city']); ?></td>
                                        <td style="color:#912CEE;"><?php echo e($item['carrieroperator']); ?></td>
                                        <td style="color:#9400D3"><?php echo e($item['ip']); ?></td>
                                        <td style="color:#2E8B57">可用</td>
                                    </tr>
                                <?php endforeach; ?>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>

            </div>
        </div>
    </div>


    <?php /*************************      服务器列表         ********************************/ ?>

    <div id="row1" class="row">
        <div class="col-sm-3" id="testAccount">
            <div class="widget style1 navy-bg ">
                <span >快速开通测试账号</span>
            </div>
        </div>
        <div class="col-sm-3" id="dayAccount">
            <div class="widget style1 navy-bg">
                <span >快速开通日卡套餐账号</span>
            </div>
        </div>
        <br><br><br><br>
        <div class="col-sm-3" id="weekAccount">
            <div class="widget style1 navy-bg">
                <span >快速开通周卡套餐账号</span>
            </div>
        </div>
        <div class="col-sm-3" id="monthAccount">
            <div class="widget style1 navy-bg">
                <span >快速开通月卡套餐账号</span>
            </div>
        </div>
    </div>

    <div class="col-sm-6">
        <div class="widget-head-color-box navy-bg p-lg text-center">
            <div class="m-b-md">
                <h2 class="font-bold no-margins">
                    牛魔代理
                </h2>
                <small></small>
            </div>
            <img src="img/img-9.png" class="img-circle circle-border m-b-md" alt="profile">
            <div>
                <span>更高</span> |
                <span>更快</span> |
                <span>更强</span>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/jquery-ui-1.10.4.min.js"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>


<script>

    $(function(){
        var day = <?php echo e($data['info']['primary-day']); ?>

        var week = <?php echo e($data['info']['primary-week']); ?>

        var month = <?php echo e($data['info']['primary-month']); ?>



        //   快速添加测试账号
        $('#testAccount').on('click',function(){

            if(confirm('开通中级套餐测试账号,有效期为一个小时,请尽快续费')) {
                $.ajax({
                    url: '/QuickOpenTestAccount',
                    type: 'get',
                    timeout: 5000,
                    dataType: 'json',
                    success: function (data, textStatus, jqXHR) {
                        if (data.error_code == 0) {
                            if (data.error_code == '0') {
                                alert('添加成功');
                            }
                        } else {
                            layer.msg(data.error_message);
                        }
                    },
                    error: function (xhr, textStatus) {
                        alert('失败！');
                    }
                })

            }
        });

        //快速添加日卡账号
        $('#dayAccount').on('click',function(){

            if(confirm('开通基础套餐日卡账号,有效期为1天,请尽快续费 ' + '￥:'+ day*1*1+'.00')) {
                $.ajax({
                    url: '/QuickOpenPayAccount',
                    type: 'get',
                    timeout: 5000,
                    data: {
                        type: 1,
                        concent_num: 1,
                        date_type: '日',
                        date: 1,
                        price: day*1*1,
                        set_meal_type:1,
                    },
                    dataType: 'json',
                    success: function (data, textStatus, jqXHR) {
                        if (data.error_code == 0) {
                            if (data.error_code == '0') {
                                alert('添加成功');

                            }
                        } else {
                            layer.msg(data.error_message);
                        }
                    },
                    error: function (xhr, textStatus) {
                        alert('失败！');
                    }
                })

            }
        });

        //快速添加周卡账号
        $('#weekAccount').on('click',function(){

            if(confirm('开通基础套餐周卡账号,有效期为7天,请尽快续费 ' + '￥:'+ week*7*1+'.00')) {
                $.ajax({
                    url: '/QuickOpenPayAccount',
                    type: 'get',
                    timeout: 5000,
                    data: {
                        type: 1,
                        concent_num: 1,
                        date_type: '周',
                        date: 1,
                        price: week*7*1,
                        set_meal_type:1,
                    },
                    dataType: 'json',
                    success: function (data, textStatus, jqXHR) {
                        if (data.error_code == 0) {
                            if (data.error_code == '0') {
                                alert('添加成功');
                            }
                        } else {
                            layer.msg(data.error_message);
                        }
                    },
                    error: function (xhr, textStatus) {
                        alert('失败！');
                    }
                })

            }
        });

        //   月卡套餐账号
        $('#monthAccount').on('click',function(){

            if(confirm('开通基础套餐月卡账号,有效期为30天 ' + '￥:'+ month*30*1+'.00')) {
                $.ajax({
                    url: '/QuickOpenPayAccount',
                    type: 'get',
                    timeout: 5000,
                    data: {
                        type: 1,
                        concent_num: 1,
                        date_type: '月',
                        date: 1,
                        price: month*30*1,
                        set_meal_type:1,
                    },
                    dataType: 'json',
                    success: function (data, textStatus, jqXHR) {
                        if (data.error_code == 0) {
                            if (data.error_code == '0') {
                                alert('添加成功');
                            }
                        } else {
                            layer.msg(data.error_message);
                        }
                    },
                    error: function (xhr, textStatus) {
                        alert('失败！');
                    }
                })

            }
        });
1
    });

    $(function(){



    });

    function findWeather() {
        var cityUrl = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js';
        $.getScript(cityUrl, function(script, textStatus, jqXHR) {
            var citytq = remote_ip_info.city ;// 获取城市
            var url = "http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&city=" + citytq + "&day=0&dfc=3";
            $.ajax({
                url : url,
                dataType : "script",
                scriptCharset : "gbk",
                success : function(data) {
                    var _w = window.SWther.w[citytq][0];
                    var _f= _w.f1+"_0.png";
                    if(new Date().getHours() > 17){
                        _f= _w.f2+"_1.png";
                    }
                    var img = "<img width='16px' height='16px' src='http://i2.sinaimg.cn/dy/main/weather/weatherplugin/wthIco/20_20/" +_f
                            + "' />";
                    var tq = citytq + " " + img + " " + _w.s1 + " " + _w.t1 + "℃～" + _w.t2 + "℃ " + _w.d1 + _w.p1 + "级";

                    $('#weather').html( tq);
                }
            });
        });
    }

    findWeather();

</script>




<!-- 自定义js -->
<script src="/js/content.js?v=1.0.0"></script>


<!-- iCheck -->
<script src="/js/plugins/iCheck/icheck.min.js"></script>

<!-- Jvectormap -->


<!-- Flot -->
<script src="/js/plugins/flot/jquery.flot.js"></script>
<script src="/js/plugins/flot/jquery.flot.tooltip.min.js"></script>
<script src="/js/plugins/flot/jquery.flot.resize.js"></script>





</body>

</html>
